<?php
// R0910CMS 
// created by TLightSky
// time : 20100412

if(!defined("IN_R0910CMS")) {
    exit("Access Denied!");
}


df('ADMIN_ROOT' , R_ROOT ."Admin" .SEP);

class Admin_Manage extends R_Manage {
	private $_tableCreateClassList = array(
		'Admin_DbModel_Admin','Admin_DbModel_Department',
		'Admin_DbModel_Menu',
		'Admin_DbModel_Right',
		'Admin_DbModel_RoleRight',
		'Admin_DbModel_Role',
		'Admin_DbModel_AdminRole',
		'Admin_DbModel_DepartmentRole',
		'Admin_DbModel_Website'
	);
	public function  loadDefaultConfig() {
		parent::loadDefaultConfig();
		$this->loadConfigFile(ADMIN_ROOT.'conf.php');
	}
	public function createAllTable() {
		foreach($this->_tableCreateClassList as $v) {
			$tb = new $v();
			$tb->create();
		}
	}
	public function dropAllTable() {
		foreach($this->_tableCreateClassList as $v) {
			$tb = new $v();
			$tb->drop();
		}
	}
    public function common(array $param=array()) {
		parent::common($param);
		getInstance("R_Action_Manage")
		  ->addPath(ADMIN_ROOT."A");
		getInstance("R_Model_Manage")
		  ->addPath(ADMIN_ROOT."M");
		getInstance("R_DbModel_Manage")
		  ->addPath(ADMIN_ROOT."DbModel");
    }
}


class Admin_Exception {}

class Admin_UserNotExist_Exception extends Admin_Exception {}

class Admin_UserWrongPassword_Exception {}